//
//  RansomMangerCell.m
//  LuCaiZhu
//
//  Created by 邓龙 on 2019/4/3.
//

#import "RansomMangerCell.h"
#import "UIColor+NN.h"

@interface RansomMangerCell()
@property (weak, nonatomic) IBOutlet UILabel *titleName;//标题
@property (weak, nonatomic) IBOutlet UILabel *startDate;//成立日或开放日
@property (weak, nonatomic) IBOutlet UILabel *endDate;//截止日
@property (weak, nonatomic) IBOutlet UILabel *shareNum;//赎回份额
@property (weak, nonatomic) IBOutlet UILabel *ransomState;//订单状态
@property (weak, nonatomic) IBOutlet UILabel *moneyNum;//存续金额
@property (weak, nonatomic) IBOutlet UILabel *ransomShare;//存续份额
@property (weak, nonatomic) IBOutlet UILabel *ransomLab;
@property (weak, nonatomic) IBOutlet UIImageView *ransomImg;
@end

@implementation RansomMangerCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setRansomManagerData:(RansomModel *)model {
    _titleName.text = model.ProductName;
    _startDate.text = model.ProductOpenDay;
    _moneyNum.text = model.SurvivingAmount;
    _ransomShare.text = model.SurvivingShareCount;
    _endDate.text = model.RedeemCloseDay;
    if ([model.IsRedeem integerValue] == 0) {
        [_ransomImg setImage:[UIImage imageNamed:@"rengou2"]];
        _ransomLab.textColor = [UIColor colorWithHexString:@"#BBBBBB"];
    }
    else {
        [_ransomImg setImage:[UIImage imageNamed:@"rengou"]];
        _ransomLab.textColor = [UIColor colorWithHexString:@"#BB3535"];
    }
}

- (void)setRansomOrderData:(RansomOrderModel *)model {
    _titleName.text = model.ProductName;
    _startDate.text = model.RedeemOpenDay;
    _shareNum.text = model.RedeemShare;
    _ransomState.text = model.Status;
}

- (void)setRenGouListData:(NSDictionary *)dic {
    _titleName.text = dic[@"TypeName"];
    _startDate.text = dic[@"ActualAmount"];
    _moneyNum.text = dic[@"OpenNet"];
    _ransomShare.text = dic[@"Actualshare"];
    _endDate.text = dic[@"OpenDay"];
}

@end
